package com.burges.net.dataStream.windows.windowAssigner

import org.apache.flink.api.java.utils.ParameterTool
import org.apache.flink.streaming.api.TimeCharacteristic
import org.apache.flink.streaming.api.scala.StreamExecutionEnvironment
import org.apache.flink.streaming.api.windowing.assigners.GlobalWindows

/**
  * 创建人    BurgessLee 
  * 创建时间   2020/1/27 
  * 描述     全局窗口的基本使用
  */
object GlobalWindowsDemo {

	def main(args: Array[String]): Unit = {

		case class WebLog(id: Long, content: String, trackTime: Long)

		val parameterTool = ParameterTool.fromArgs(args)

		val env = StreamExecutionEnvironment.getExecutionEnvironment

		env.setStreamTimeCharacteristic(TimeCharacteristic.EventTime)
		val inputStream = env.fromElements(WebLog(2, "flink", 21L), WebLog(4, "flink", 1L), WebLog(3, "flink", 4L))

		inputStream.keyBy(_.id)
				//通过GlobalWindows定义GlobalWindows
				.window(GlobalWindows.create())
//        		.process(...)


	}

}
